<template>
	<view class="info">
		<image :src="qrcode" @click="preview" mode="widthFix"></image>
		<view class="text">扫码订阅通知消息</view>
	</view>
</template>

<script>
import { subscribe } from '../../api/user';

	export default {
		data() {
			return { 
				
				qrcode:"",
			}
		},
		onShow(){
			 

			
			this.getQuery();
	 
			
			
		},
		methods: {
			
			preview(){
				
				uni.previewImage({
					current:0,
					urls:[this.qrcode],
				})
			},
			
			async getQuery(){
				
				const res=await subscribe();
				
				if(res.code==1){
					this.qrcode=res.data;
				}
				
			}
			
			
		}
	}
</script>

<style scoped lang="scss">
	.info{
		 padding: 40rpx;
		 background: #fff;
		 text-align: center;
		 .text{
			 font-size: 20px;
		 }
	}

</style>
